-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internals rewrite: clean up checks and hypothesis functionality #1109
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1109 +/- ##
==========================================
+ Coverage 97.23% 97.41% +0.17%
==========================================
Files 63 67 +4
Lines 4710 4789 +79
==========================================
+ Hits 4580 4665 +85
+ Misses 130 124 -6
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
this PR is part 2 in the effort to decouple pandas-specific validation logic from the pandera schema specification: #381 |
This PR organizes the checks and hypothesis modules across the
core
andbackend
subpackages for overall consistency:pandera.core.{checks, hypotheses}
module specifies the public-facing class API for checks and hypotheses. This provides a way for users to access built-in checks/hypotheses with full auto-completion on an IDE. These methods delegate to thebuiltin_{checks, hypotheses}
modules.pandera.backends.base.builtin_{checks, hypotheses}
modules implement base function implementations that usemultimethod
to dispatch the implementation to a specific data framework (e.g.pandera.backends.pandas.builtin_{checks, hypotheses}
@{Check, Hypothesis}.register_builtin_check_fn
, and framework-specific implementations are marked with@register_builtin_{check, hypothesis}
This PR also cleans up the way
SchemaErrors
failure cases are handled. Instead of having pandas-specific logic in theSchemaErrors
methods:failure_cases_metadata
method was introduced in theBaseSchemaBackend
class to handle consolidating and summarizing failure cases from across multiple checks.FailureCaseMetadata
namedtuple class to clarify the metadata needed bySchemaErrors
.